<?php
namespace app\admin\model;
use think\Model;
use think\Session;

class Money extends Model{

   public function getList(){
        return $this->select();
   }

   //分页数据,权限判断
   public function getPage(){
       //当前登录用户的id
       $id=Session::get('trade_user_id');
       if($id==1){
           return $this::paginate();
       }else{
           $childId= db('user')->where('pid',$id)->column('id');
           $childId[]=$id;

           $childId=implode(',',$childId);
           $res=$this::where('id','in',$childId)->paginate();
           return $res;
       }
   }

}